home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 1 / CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso / Aminet / comm / tcp / AmiTCPsdk_40.lha / AmiTCP-4.0 / netinclude / sys / cdefs.h next >
C/C++ Source or Header  |  1994-10-05  |  2KB  |  80 lines

  1. #ifndef    SYS_CDEFS_H
  2. #define    SYS_CDEFS_H \
  3.        "$Id: cdefs.h,v 4.1 1994/10/05 23:16:17 ppessi Exp $"
  4. /*
  5.  *      C compiler dependent definitions
  6.  *
  7.  *      Copyright © 1994 AmiTCP/IP Group,
  8.  *                       Network Solutions Development, Inc.
  9.  *                       All rights reserved.
  10.  */
  11.  
  12. #if defined(__cplusplus)
  13. #define    __BEGIN_DECLS    extern "C" {
  14. #define    __END_DECLS    };
  15. #else
  16. #define    __BEGIN_DECLS
  17. #define    __END_DECLS
  18. #endif
  19.  
  20. /*
  21.  * SAVEDS should be used in all function definitions which will be called 
  22.  * from other tasks than AmiTCP/IP. Is restores the global data base pointer
  23.  * as the first thing in the function body.
  24.  *
  25.  * REGARGFUN contains special keywords which should be used when functions
  26.  * used through shared library are referenced.
  27.  */
  28. #if __SASC_60
  29. #define SAVEDS __saveds
  30. #define REGARGFUN __asm
  31. #define STKARGFUN __stdargs
  32. #define ALIGNED __aligned
  33. #define ASM __asm
  34. #define REG(x) register __##x
  35. #else
  36. #define SAVEDS
  37. #define REGARGFUN
  38. #define STKARGFUN
  39. #define ALIGNED
  40. #define ASM
  41. #define REG(x)
  42. #endif
  43.  
  44. /*
  45.  * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
  46.  * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
  47.  * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
  48.  * in between its arguments.  __CONCAT can also concatenate double-quoted
  49.  * strings produced by the __STRING macro, but this only works with ANSI C.
  50.  */
  51. #if defined(__STDC__) || defined(__cplusplus)
  52. #define    __P(protos)    protos        /* full-blown ANSI C */
  53. #define    __CONCAT(x,y)    x ## y
  54. #define    __STRING(x)    #x
  55.  
  56. #if __SASC_60
  57. #define inline          __inline
  58. #endif
  59.  
  60. #else    /* !(__STDC__ || __cplusplus) */
  61. #define    __P(protos)    ()        /* traditional C preprocessor */
  62. #define    __CONCAT(x,y)    x/**/y
  63. #define    __STRING(x)    "x"
  64.  
  65. #if __GNUC__
  66. #define    const        __const__    /* GCC: ANSI C with -traditional */
  67. #define    inline        __inline__
  68. #define    signed        __signed__
  69. #define    volatile    __volatile__
  70.  
  71. #else    /* !__GNUC__ */
  72. #define    const                /* delete ANSI C keywords */
  73. #define    inline
  74. #define    signed
  75. #define    volatile
  76. #endif    /* !__GNUC__ */
  77. #endif    /* !(__STDC__ || __cplusplus) */
  78.  
  79. #endif /* !SYS_CDEFS_H */
  80.